import request from '@/utils/request'

// 查询布控列表
export function listTask(query) {
  return request({
    url: '/alarm/task/list',
    method: 'get',
    params: query
  })
}

// 查询布控详细
export function getTask(id) {
  return request({
    url: '/alarm/task/' + id,
    method: 'get'
  })
}

// 新增布控

export function addTask(data) {
  return request({
    url: '/alarm/task',
    method: 'post',
    data: data
  })
}

// 修改布控

export function updateTask(data) {
  return request({
    url: '/alarm/task',
    method: 'put',
    data: data
  })
}

// 删除布控

export function delTask(id) {
  return request({
    url: '/alarm/task/' + id,
    method: 'delete'
  })
}

export function queryAllByTasksStatusIs0() {
  return request({
    url: '/alarm/task/queryAllByTasksStatusIs0',
    method: 'get'
  })
}

export function queryAllByTasksStatusIs1() {
  return request({
    url: '/alarm/task/queryAllByTasksStatusIs1',
    method: 'get'
  })
}

export function queryAllByTasksStatusIs2() {
  return request({
    url: '/alarm/task/queryAllByTasksStatusIs2',
    method: 'get'
  })
}

export function queryAllByTasksStatusIs3() {
  return request({
    url: '/alarm/task/queryAllByTasksStatusIs3',
    method: 'get'
  })
}

export function queryAllByTasksStatusIs4() {
  return request({
    url: '/alarm/task/queryAllByTasksStatusIs4',
    method: 'get'
  })
}



export function updateByStatusIs1(id) {
  return request({
    url: '/alarm/task/updateByStatus1/'+id,
    method: 'get'
  })
}

export function updateByStatusIs2(id) {
  return request({
    url: '/alarm/task/updateByStatus2/'+id,
    method: 'get'
  })
}

export function removeTask(id) {
  return request({
    url: '/alarm/task/removeTask/'+id,
    method: 'get'
  })
}

// 查询实有人口列表
export function listResidents(query) {
  return request({
    url: '/alarm/task/listResidents',
    method: 'get',
    params: query
  })
}


export function insertTaskWithManyPhoto(data) {
  return request({
    url: '/alarm/task/insertTaskWithManyPhoto',
    method: 'post',
    data: data
  })
}

export function updateByStatusTo1(id) {
  return request({
    url: '/alarm/task/updateByStatusTo1/'+id,
    method: 'get'
  })
}
